package com.example.myspringboot.service;


import com.example.myspringboot.mapper.DataMapper;
import com.example.myspringboot.model.myData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DataService {
	@Autowired(required = false)
	private DataMapper dataMapper;
	
	
	public String insert(String id,String username,String address){
		dataMapper.insert(id, username, address);
		return "succeed";
	}
	/**
	 * 查询id对应的信息
	 *
	 */
	public myData findById(String id) {
		return dataMapper.findById(id);
	}
	/**
	 * 更新信息
	 *
	 */
//	public void update(myData data) {
//		dataMapper.update(data);
//	}
	
	/**
	 * 删除id对应的信息
	 *
	 */
	public void delete(String id) {
		dataMapper.delete(id);
	}
}
